{include file="header.htm" /}
<link href="__SKIN__/css/main.css?v={$version}" rel="stylesheet" type="text/css">
<link href="__SKIN__/css/page.css?v={$version}" rel="stylesheet" type="text/css">
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit; min-width:400px;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page" style="min-width: 400px;">
    <div class="flexigrid flexigrid-xin">
        <div class="header-bar">
            <div class="more">
                <div class="search">
                    <div class="content">
                        <form id="searchForm" action="{:weapp_url('DealerPlugin/DealerPlugin/dealer_customer')}" method="get" onsubmit="layer_loading('正在处理');" style="display: unset;">
                            {$searchform.hidden|default=''}
                            <input type="hidden" name="users_id" value="{$users_id}">
                            <div class="ey-form-item"><label class="users-form-item-label">关键词：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <!-- 订单号查询 -->
                                            <div class="sDiv2">
                                                <input type="text" size="50" name="keywords" id="keywords" value="{$Request.param.keywords}" class="qsbox" style="width: 170px;" placeholder="搜索会员昵称/手机号...">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="ey-form-item"><label class="users-form-item-label">首次绑定时间：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <div class="sDiv2">
                                                <input type="text" name="add_time_begin" id="add_time_begin" autocomplete="off" value="{$Request.param.add_time_begin}" class="qsbox" placeholder="起始日期">
                                            </div>
                                            &nbsp;至&nbsp;
                                            <div class="sDiv2">
                                                <input type="text" name="add_time_end" id="add_time_end" autocomplete="off" value="{$Request.param.add_time_end}" class="qsbox" placeholder="结束日期">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <div class="ey-form-item" style="margin-left: 20px;">
                            <div class="users-form-item-content">
                                <span class="bt-xin" onclick="customerQuery();">查询</span>
                                <span class="bt-xin-no" onclick="customerQuery(this);" data-url="{:weapp_url('DealerPlugin/DealerPlugin/dealer_customer', ['users_id'=>$users_id])}">重置</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="flexigrid member_lt" style="padding-top: 20px;">
        {empty name="customer"}
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%;">
                    <thead>
                        <tr>
                            <!-- <th axis="col4"> <div class="tl text-l10">会员名/会员昵称</div> </th> -->
                            <th axis="col4"> <div class="tl text-l10">会员昵称</div> </th>
                            <th axis="col4" class="w150"> <div class="tc">会员手机号</div> </th>
                            <th axis="col4" class="w120"> <div class="tc">分佣订单数</div> </th>
                            <th axis="col4" class="w120"> <div class="tc">贡献佣金额</div> </th>
                            <th axis="col4" class="w160"> <div class="tc">首次绑定时间</div> </th>
                            <th axis="col4" class="w160"> <div class="tc">最近下单时间</div> </th>
                        </tr>
                    </thead>
                    <tbody>
                        
                    </tbody>
                </table>
                <div class="no_row" style="background: #FFF; width: auto;">
                    <div class="no_pic" style=" width: auto; line-height: 350px !important; height: 380px; text-align: center; margin: 0 auto; position: unset !important;"><img src="__SKIN__/images/null-data.png"></div>
                </div>
            </div>
        </div>
        {else/}
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%;">
                    <thead>
                        <tr>
                            <!-- <th axis="col4"> <div class="tl text-l10">会员名/会员昵称</div> </th> -->
                            <th axis="col4"> <div class="tl text-l10">会员昵称</div> </th>
                            <th axis="col4" class="w150"> <div class="tc">会员手机号</div> </th>
                            <th axis="col4" class="w120"> <div class="tc">上级分销商</div> </th>
                            <th axis="col4" class="w120"> <div class="tc">分佣订单数</div> </th>
                            <th axis="col4" class="w120"> <div class="tc">贡献佣金额</div> </th>
                            <th axis="col4" class="w160"> <div class="tc">首次绑定时间</div> </th>
                            <th axis="col4" class="w160"> <div class="tc">最近下单时间</div> </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                        {foreach name="customer" item="vo" key="k" }
                        <tr>
                            <td style="width: 100%">
                                <div class="pl10 text-l10 tl">
                                    <img id="img_head_pic" class="fl" style="width: 40px; height: 40px;" src="{$vo.head_pic|get_head_pic=###}">
                                    <!-- <p style="margin-top: -5px;"> <a href="JavaScript:void(0);" data-href="{:url('Member/users_edit', array('id'=>$vo['users_id']))}" onclick="openFullframe(this, '编辑会员', '100%', '100%');">{$vo.username}</a> </p>
                                    <p style="margin-top: -10px; color: #cccccc; font-size: 12px;"> <a href="JavaScript:void(0);" data-href="{:url('Member/users_edit', array('id'=>$vo['users_id']))}" onclick="openFullframe(this, '编辑会员', '100%', '100%');">{$vo.nickname}</a> </p> -->
                                    <p style="color: #cccccc; font-size: 12px;"> <a href="JavaScript:void(0);" data-href="{:url('Member/users_edit', array('id'=>$vo['users_id']))}" onclick="openFullframe(this, '编辑会员', '100%', '100%');">{$vo.nickname}</a> </p>
                                </div>
                            </td>
                            <td> <div class="w150 tc"> {$vo.mobile} </div> </td>
                            <td>
                                <div class="w120 tc">
                                    <p style="margin-top: -5px;"> {$vo.parentDealer.dealer_name} </p>
                                    <p style="margin-top: -10px;"> {$vo.parentDealer.dealer_mobile} </p>
                                </div>
                            </td>
                            <td> <div class="w120 tc"> {$vo.order_num} </div> </td>
                            <td> <div class="w120 tc"> {$vo.dealer_total_money} </div> </td>
                            <td> <div class="w160 tc"> {$vo.bind_dealer_time} </div> </td>
                            <td> <div class="w160 tc"> {$vo.last_order_time} </div> </td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        {/empty}
        <div class="footer-oper">
            {$page}
            <div style="clear:both"></div>
        </div>
	</div>
</div>

<script type="text/javascript">
    layui.use('laydate', function() {
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#add_time_begin' //指定元素
        });
        laydate.render({
            elem: '#add_time_end' //指定元素
        });
    });

    // 分销商客户查询
    $(document).keydown(function(event) {
        if (event.keyCode == 13) {
            $('#searchForm input[type=text]').each(function(index, item) {
                if ($(item).is(':focus')) customerQuery();
            });
        }
    });

    function customerQuery(obj) {
        var url = $(obj).data('url') ? $(obj).data('url') : '';
        if (url) {
            window.location.href = url;
        } else {
            $('#searchForm').submit();
        }
    }
</script>

{include file="footer.htm" /}